package main

import (
	"fmt"
	"unsafe"
)

type Book struct {
	title   string
	author  string
	subject string
	bookId  int
}

type guid struct {
	area uint8
	zone uint8
	inst uint8
	seri uint8
}

func (this *guid) printStruct() {
	fmt.Printf("area:%d, zone:%d, inst:%d, seri:%d\n", this.area, this.zone, this.inst, this.seri)
}

func main() {
	book1 := Book{"1", "chabon", "my book", 1}
	book2 := Book{title: "2", author: "chabon", subject: "my book", bookId: 2}

	fmt.Println(book1, book2)
	fmt.Printf("%v\n", book1)

	id := guid{1, 2, 3, 4}
	fmt.Printf("%x\n", *((*uint32)(unsafe.Pointer(&id))))
	id.printStruct()
}
